package fr.babostesting.examples.mobile.start 
{
	import flash.display.DisplayObjectContainer;
	import flash.ui.Multitouch;
	import fr.babos.core.actions.IAction;
	import fr.babos.core.bundle.Bundle;
	import fr.babos.touch.emulator.MouseToTouchEmulator;
	import fr.babostesting.examples.mobile.actions.ExampleActions;
	import fr.babostesting.examples.mobile.controllers.app.MExampleAppController;
	import fr.babostesting.examples.mobile.controllers.pages.HomeViewController;
	import fr.babostesting.examples.mobile.controllers.pages.MentionsViewController;
	import fr.babostesting.examples.mobile.controllers.pages.SearchViewController;
	import fr.babostesting.examples.mobile.controllers.pages.TrendsViewController;
	import fr.babostesting.examples.mobile.controllers.pages.TweetListViewController;
	
	/**
	 * ...
	 * @author ZoulouX
	 */
	public class MExampleBundle extends Bundle 
	{
		/**
		 * L'instance du Bundle de l'application
		 */
		protected static var __instance			:MExampleBundle;
		
		/**
		 * Récupérer le Bundle de l'application
		 */
		public static function get instance ():MExampleBundle
		{
			return __instance;
		}
		
		/**
		 * Le constructeur
		 * @param	pDisplayContainer
		 * @param	pDefaultAction
		 * @param	pAutoInit
		 * @param	pAutoDispose
		 */
		public function MExampleBundle (pDisplayContainer:DisplayObjectContainer = null, pDefaultAction:IAction = null)
		{
			// Enregistrer l'instance
			__instance = this;
			
			// Relayer la construction
			super(pDisplayContainer, pDefaultAction);
		}
		
		/**
		 * Préparation du Bundle
		 */
		override protected function prepare ():void
		{
			// Créer le controlleur de base de l'application
			buildAppController(MExampleAppController);
		}
		
		/**
		 * Gestion des dépendances de l'application
		 */
		override protected function initDependences ():void
		{
			
		}
		
		/**
		 * Initialiser les actions de l'application
		 */
		override protected function initActions ():void
		{
			_bootstrap.mapAction(ExampleActions.HOME_ACTION, HomeViewController);
			_bootstrap.mapAction(ExampleActions.MENTIONS_ACTION, MentionsViewController);
			_bootstrap.mapAction(ExampleActions.SEARCH_ACTION, SearchViewController, {
				query: ""
			});
			_bootstrap.mapAction(ExampleActions.TRENDS_ACTION, TrendsViewController);
			_bootstrap.mapAction(ExampleActions.TWEET_LIST_ACTION, TweetListViewController);
		}
	}
}